package com.iotek.bookstore.modle.service.serviceimpl;

import com.iotek.bookstore.modle.dao.impl.AddressDaoImpl;
import com.iotek.bookstore.modle.entity.Address;

import java.util.List;

public class AddressBizImpl extends MyBookstoreBizImpl<Address> {
    public AddressBizImpl() {
        myBookstoreDao=new AddressDaoImpl();
    }

    @Override
    public int insert(Address address) {
        return myBookstoreDao.insert(address);
    }

    @Override
    public List<Address> queryAll() {
        return myBookstoreDao.queryAll();
    }

    @Override
    public List<Address> query(int id) {
        return myBookstoreDao.query(id);
    }

    /*
    * 根据用户ID（地址ID）查询地址信息
    * type：判断是用户ID还是地址ID
    * */
    @Override
    public List<Address> query(long id, String type) {
        return myBookstoreDao.query(id,type);
    }


    /*
    * 根据地址ID删除地址信息
    * */
    @Override
    public int delete(long id) {
        return myBookstoreDao.delete(id);
    }

    /*
    * 根据地址ID更改地址信息
    * */
    @Override
    public int update(Address address) {
        return myBookstoreDao.update(address);
    }
}
